﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebSite.DAL.Db.Repositories;
using WebSite.Models;
using WebSite.Repositories;

namespace WebSite.Controllers
{
    public class HomeController : HWBaseController
    {
        private IPageDataRepository _repository;

        #region Construction
        
        public HomeController(IPageDataRepository repo)
        {
            _repository = repo; 
        }

        public HomeController()
            :this(/*new PageDataFakeRepository()*/new PageDataDbRepository(
                    new DbMainPageItemsRepository("DbСontext"), new DbCourseGroupRepository("DbСontext"), new DbLayoutRepository("DbСontext")))
        {
        }

        #endregion

        [OutputCache(CacheProfile = "StaticPage")]
        public ActionResult Index()
        {
            return View(_repository.LoadMainPageData());
        }
    }
}
